using System;
using PropertyExpression.Common;

namespace PropertyExpression.ControllableQuery.Test.Queries.StringBuilding
{
    public class PublicationTypeUpdateQuery : INonQuery
    {
        private readonly IParam<Guid> publicationTypeId;
        private readonly IParam<IOption<NVarChar<L4000>>> description;

        public PublicationTypeUpdateQuery(
            IParam<Guid> publicationTypeId,
            IParam<IOption<NVarChar<L4000>>> description)
        {
            this.publicationTypeId = publicationTypeId;
            this.description = description;
        }

        public string TransformText()
        {
            publicationTypeId.ToSql("@PublicationTypeId");
            description.ToSql("@Description");
            return
                @"UPDATE
    PublicationType
SET 
    Description = @Description
WHERE
    PublicationTypeId = @PublicationTypeId";
        }
    }
}